import { Controller } from "../../mvc/core/Controller";
import { EffectManager } from "../manager/EffectManager";
import { UIIconEvent } from "../view/uiIconBtn/UIIconEvent";
import { Alert } from "../../../com/mui/controls/Alert";
import { Language } from "../../../extend/language/Language";
import { MsgManager } from "../manager/MsgManager";
import { GameProxy } from "../mvc/GameProxy";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { ServerCommand } from "../mvc/ServerCommand";
import { EGateCommand } from "../../../Message/Command/EGateCommand";
import { ITransportModule } from "../../../modules/interfaces/ITransportModule";
import { TransportModule } from "../../../modules/TransportModule";
import { EventName } from "../mvc/EventName";
import { ITransportInfoModule } from "../../../modules/interfaces/ITransportInfoModule";
import { TransportInfoModule } from "../../../modules/TransportInfoModule";
import { WindowEvent } from "../../component/window/WindowEvent";
import { HintIcon } from "../view/uiIconBtn/HintIcon";
import { ImagesConst } from "../resource/ImagesConst";
import { PlayerEvent } from "../scene/events/PlayerEvent";
import { AIManager } from "../scene/ai/AIManager";
import { DataEvent } from "../events/DataEvent";
import { IView } from "../../mvc/interfaces/IView";
import { ECategory } from "../../../Message/Public/ECategory";
import { EProp } from "../../../Message/Public/EProp";
import { QuickBuyWindow } from "../view/common/QuickBuyWindow";
import { ShopRule } from "../rules/ShopRule";
import { ShopConfig } from "../resource/ShopConfig";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { TransportInfo } from "../model/TransportInfo";
import { ETaskGroup } from "../../../Message/Game/ETaskGroup";
import { TaskInfo } from "../model/TaskInfo";
import { RolePlayer } from "../scene/player/entity/RolePlayer";
import { MessageBlock } from "../../../Framework/MQ/MessageBlock";
import { STransportFailReward } from "../../../Message/Game/STransportFailReward";
import { HTMLUtil } from "../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../resource/ColorConfig";
import { STransportHelpInfo } from "../../../Message/Game/STransportHelpInfo";
import { TimerAlertWin } from "../view/common/alertwins/TimerAlertWin";
import { GameConst } from "../../component/gconst/GameConst";
import { EEntityFightMode } from "../../../Message/Public/EEntityFightMode";
import { GameMapUtil } from "../scene/map/GameMapUtil";
import { SceneConfig } from "../resource/SceneConfig";
import { EPassType } from "../../../Message/Game/EPassType";
import { GameController } from "../mvc/GameController";
import { DailyInfo } from "../model/DailyInfo";
import { ENpcEffect } from "../../../Message/Public/ENpcEffect";
import { AIType } from "../scene/ai/AIType";
import { ETaskStatus } from "../../../Message/Game/ETaskStatus";
import { STask } from "../../../Message/Game/STask";
import { SKillTransportReward } from "../../../Message/Game/SKillTransportReward";
import { ItemConfig } from "../resource/ItemConfig";
import { UiHintIconView } from "../view/uiIconBtn/UiHintIconView";
type int = number;
//class TransportController
    
    export  class TransportController extends Controller
    {
       

        /* internal  */hideTransportHelp(): void
        {
            if (this._transportHelp && this._transportHelp.parent) 
            {
                this._transportHelp.parent.removeChild(this._transportHelp);
                EffectManager.glowFilterUnReg(this._transportHelp);
                this._transportHelp.dispatchEvent(new UIIconEvent(UIIconEvent.RemoveIcon));
            }
            return;
        }

        /* internal  */onTransIconClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            EffectManager.glowFilterUnReg(this.transportIcon);
            this.transportInfo.updateData(cache.transport.transportInfo);
            this.transportInfo.show();
            return;
        }

        /* internal  */onHelpIconClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (cache.guild.myGuildInfo != null) 
            {
                Alert.show(Language.getStringByParam(20364, "<br><font color=\'#00ff00\'>（", "）</font>"), null, Alert.OK | Alert.CANCEL, null, this.onHelpIconAlertHandler);
            }
            else 
            {
                MsgManager.showRollTipsMsg(Language.getString(20363));
            }
            return;
        }

        /* internal  */onHelpIconAlertHandler(arg1: int): void
        {
            if (arg1 == Alert.OK) 
            {
                GameProxy.transport.helpTransportReq();
                this.hideTransportHelp();
            }
            return;
        }

        protected /* override */ initServer(): void
        {
            super.initServer();
            NetDispatcher.addCmdListener(ServerCommand.TransportTalkRes, this.onTransportTalkRes);
            NetDispatcher.addCmdListener(ServerCommand.TransportInfoRes, this.onTransportInfoRes);
            NetDispatcher.addCmdListener(ServerCommand.TransportInfoUpdate, this.onTransportInfoUpdate);
            NetDispatcher.addCmdListener(ServerCommand.TransportBegin, this.onTransportBeginRes);
            NetDispatcher.addCmdListener(ServerCommand.TransportBuyInsuRes, this.onTransportBuyInsuRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateTransportFail, this.onTransportFailRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateTransportHelp, this.onTransportHelpRes);
            NetDispatcher.addCmdListener(ServerCommand.TransportTaskInfoRes, this.onTransTaskInfoRes);
            NetDispatcher.addCmdListener(ServerCommand.TaskEndRes, this.onTaskEndRes);
            NetDispatcher.addCmdListener(ServerCommand.TaskUpdate, this.onTaskUpdatesRes);
            NetDispatcher.addCmdListener(ServerCommand.TaskListRes, this.onTaskListRes);
            NetDispatcher.addCmdListener(ServerCommand.TaskDel, this.onTaskDelRes);
            NetDispatcher.addCmdListener(EGateCommand._ECmdGateKillTransportReward, this.onKillTransRewardRes);
            return;
        }

        public get transport(): ITransportModule
        {
            if (!this._transport) 
            {
                this._transport = new TransportModule();
                this._transport.addEventListener(EventName.TransportInfoReq, this.onTransportReq);
                this._transport.addEventListener(EventName.TransportFlushReq, this.onTransportFlushReq);
                this._transport.addEventListener(EventName.TransportBeginReq, this.onTransportBeginReq);
                this._transport.addEventListener(EventName.TransportMoveAward, this.onTransportMoveAward);
            }
            return this._transport;
        }

        public get transportInfo(): ITransportInfoModule
        {
            if (!this._transportInfo) 
            {
                this._transportInfo = new TransportInfoModule();
                this._transportInfo.addEventListener(WindowEvent.CLOSE, this.onTransportInfoCloseHandler);
            }
            return this._transportInfo;
        }

        public get transportIcon(): HintIcon
        {
            if (!this._transportIcon) 
            {
                this._transportIcon = new HintIcon(ImagesConst.TransportBeginIcon);
                this._transportIcon.addEventListener(flash.events.MouseEvent.CLICK, this.onTransIconClickHandler);
            }
            return this._transportIcon;
        }

        public get transportHelp(): HintIcon
        {
            if (!this._transportHelp) 
            {
                this._transportHelp = new HintIcon(ImagesConst.TransportHelpIcon, false);
                this._transportHelp.addEventListener(flash.events.MouseEvent.CLICK, this.onHelpIconClickHandler);
            }
            return this._transportHelp;
        }

        /* internal  */onWalkStartHandler(arg1: PlayerEvent): void
        {
            if (cache.guide.transportIng && cache.transport.transportInfo && cache.transport.transportInfo.taskTarget) 
            {
                if (AIManager.checkLastTargetAsNPC(cache.transport.transportInfo.taskTarget.id)) 
                {
                    if (this._transportIcon && this._transportIcon.parent) 
                    {
                        EffectManager.glowFilterUnReg(this._transportIcon);
                    }
                }
                else if (this._transportIcon && this._transportIcon.parent) 
                {
                    EffectManager.glowFilterReg(this._transportIcon);
                }
            }
            return;
        }

        /* internal  */onTransportReq(arg1: DataEvent): void
        {
            GameProxy.transport.openTransportReq(cache.dialog.npcInfo.tnpc.npcId);
            return;
        }

        protected /* override */ initView(): IView
        {
            return this.transport;
        }

        /* internal  */onTransportFlushReq(arg1: DataEvent): void
        {
            var loc1=0;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            if (!(cache.transport.transportInfo.totalCount < 1 && cache.role.entityInfo.level <= 38 && cache.transport.transportInfo.color < 4)) 
            {
                if (cache.transport.transportInfo.color < 5) 
                {
                    loc1 = cache.transport.transportInfo.freeCount;
                    if (cache.vip.isVIP) 
                    {
                        loc1 = loc1 + (cache.vip.getAttributeMaxNumber("EVIPCodeTransportTaskTimes") - cache.vip.vipInfo.transportTimes);
                    }
                    if (loc1 == 0) 
                    {
                        loc2 = cache.pack.backPackCache.getTypeItems(ECategory._ECategoryProp, EProp._EPropTransportFlushToken);
                        if (!loc2 || loc2.length == 0) 
                        {
                            if (!cache.transport.transportInfo.autoBuy) 
                            {
                                (loc3 = QuickBuyWindow.instance).updateWindow(ECategory._ECategoryProp, EProp._EPropTransportFlushToken, 1, -1, false, ShopRule.FishShop);
                                loc3.show();
                                return;
                            }
                            if (this._flushTokenCoin == -1) 
                            {
                                if (loc4 = ShopConfig.instance.getItemByType(ECategory._ECategoryProp, EProp._EPropTransportFlushToken, 1, -1, false, ShopRule.FishShop)) 
                                {
                                    this._flushTokenCoin = loc4.tshopSell.price;
                                }
                            }
                            if (cache.login.loginGame.money.coin + cache.login.loginGame.money.coinBind < this._flushTokenCoin) 
                            {
                                Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, this._flushTokenCoin));
                                MsgManager.showRollTipsMsg(Language.getString(20038));
                                return;
                            }
                        }
                    }
                }
            }
            GameProxy.transport.flushTransportReq(cache.dialog.npcInfo.tnpc.npcId, cache.transport.transportInfo.autoBuy, cache.transport.transportInfo.flushCount, cache.transport.transportInfo.flushColor);
            return;
        }

        /* internal  */onTransportBeginReq(arg1: DataEvent): void
        {
            if (cache.battle.isInBattle) 
            {
                MsgManager.showRollTipsMsg(Language.getString(20284));
                return;
            }
            if (cache.login.loginGame.money.coin + cache.login.loginGame.money.coinBind < cache.transport.transportInfo.cashPledge) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.ShopMallAutoBuyCoin, cache.transport.transportInfo.cashPledge));
                MsgManager.showRollTipsMsg(Language.getString(20285));
                return;
            }
            if (!this.transport.isHide) 
            {
                this.transport.hide();
            }
            GameProxy.transport.beginTranportReq(cache.dialog.npcInfo.tnpc.npcId);
            return;
        }

        /* internal  */onTransportMoveAward(arg1: DataEvent): void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.TransportMoveAward, cache.transport.transportInfo));
            return;
        }

        /* internal  */onTransportTalkRes(arg1: TransportInfo): void
        {
            if (arg1.transportAble) 
            {
                GameProxy.transport.openTransportReq(cache.dialog.npcInfo.tnpc.npcId);
            }
            return;
        }

        /* internal  */onTransportInfoRes(arg1: TransportInfo): void
        {
            if (this.transport.isHide) 
            {
                this.transport.show();
            }
            this.transport.updateData(arg1);
            return;
        }

        /* internal  */onTransTaskInfoRes(arg1: TransportInfo): void
        {
            var loc1=null;
            var loc2=null;
            if (cache.guide.transportIng) 
            {
                loc1 = cache.task.getTaskByGroup(ETaskGroup._ETaskGroupTransport);
                if (loc1.length != 0) 
                {
                    loc2 = loc1[0];
                    if (loc2 != null) 
                    {
                        cache.transport.transportInfo.taskTarget = loc2.getTargetByIndex(0);
                    }
                }
                this.showTransportIcon();
            }
            return;
        }

        /* internal  */onTransportInfoUpdate(arg1: TransportInfo): void
        {
            if (!this.transport.isHide) 
            {
                this.transport.updateColor(arg1);
            }
            return;
        }

        /* internal  */onTransportBeginRes(arg1: TaskInfo): void
        {
            cache.transport.transportInfo.taskTarget = arg1.getTargetByIndex(0);
            if (cache.pack.mountsPackCache.hadCallMount) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.UnCallMounts));
            }
            this.showTransportIcon();
            AIManager.onAutoPathAIControl(cache.transport.transportInfo.taskTarget);
            RolePlayer.instance.addEventListener(PlayerEvent.WALK_START, this.onWalkStartHandler);
            return;
        }

        /* internal  */onTransportBuyInsuRes(arg1: Object): void
        {
            cache.transport.transportInfo.insureBuy = true;
            MsgManager.showRollTipsMsg(Language.getString(20287));
            MsgManager.addTipText(Language.getString(20287));
            return;
        }

        /* internal  */onTransportFailRes(arg1: MessageBlock): void
        {
            var loc2=null;
            var loc1=arg1.messageBase as STransportFailReward;
            MsgManager.addTipText(Language.getString(20288));
            MsgManager.showRollTipsMsg(Language.getString(20288));
            if (loc1.killByPlayer && !(loc1.killerMiniPlayer.name == cache.role.entityInfo.name)) 
            {
                loc2 = Language.getStringByParam(20289, HTMLUtil.addColor(loc1.killerMiniPlayer.name, ColorConfig.instance.getCampColor(loc1.killerMiniPlayer.camp).color), loc1.finalExp);
                Alert.show(loc2, null, Alert.OK);
            }
            else if (loc1.cashPledge != 0) 
            {
                Alert.show(Language.getStringByParam(20290, HTMLUtil.addColor(loc1.finalExp + "", "#ffff00")) + "，" + Language.getStringByParam(20291, HTMLUtil.addColor(loc1.cashPledge + "", "#ffff00")), null, Alert.OK);
            }
            else 
            {
                Alert.show(Language.getStringByParam(20290, HTMLUtil.addColor(loc1.finalExp + "", "#ffff00")), null, Alert.OK);
            }
            this.hideTransportIcon();
            this.hideTransportHelp();
            if (this._transportInfo && !this._transportInfo.isHide) 
            {
                this._transportInfo.hide();
            }
            AIManager.cancelAll();
            RolePlayer.instance.removeEventListener(PlayerEvent.WALK_START, this.onWalkStartHandler);
            return;
        }

        /* internal  */onTransportHelpRes(arg1: MessageBlock): void
        {
            if (cache.role.entityInfo.level < 30) 
            {
                return;
            }
            var loc1=arg1.messageBase as STransportHelpInfo;
            Alert.timerOut = 15;
            Alert.timerNO = true;
            Alert.alertWinRenderer = TimerAlertWin;
            Alert.buttonWidth = 60;
            Alert.extendObj = loc1;
            Alert.show(Language.getStringByParam(20292, HTMLUtil.addColor(loc1.ownerMiniPlayer.name, ColorConfig.instance.getCampColor(loc1.ownerMiniPlayer.camp).color)), null, Alert.OK | Alert.CANCEL, null, this.helpAlertHandler);
            return;
        }

        /* internal  */helpAlertHandler(arg1: int, arg2: Object): void
        {
            var loc1=null;
            if (arg1 == Alert.OK) 
            {
                if (cache.task.inTransport()) 
                {
                    MsgManager.showRollTipsMsg(Language.getString(20283));
                    return;
                }
                if (cache.role.entityInfo.level >= GameConst.SetFightModeLevel) 
                {
                    if (RolePlayer.instance.entityInfo.entityInfo.fightModel != EEntityFightMode._EEntityFightModePeace) 
                    {
                        this.onConveyAlertHandler(Alert.OK, arg2);
                    }
                    else if (GameMapUtil.isEnemyMap(arg2.mapId)) 
                    {
                        loc1 = SceneConfig.instance.getSceneInfo(arg2.mapId);
                        Alert.extendObj = arg2;
                        Alert.show(Language.getStringByParam(20301, loc1.sMapDefine.name), null, Alert.OK | Alert.CANCEL, null, this.onConveyAlertHandler);
                    }
                    else 
                    {
                        this.onConveyAlertHandler(Alert.OK, arg2);
                    }
                }
                else if (GameMapUtil.isEnemyMap(arg2.mapId)) 
                {
                    Alert.show(Language.getStringByParam(20302, GameConst.SetFightModeLevel));
                }
                else 
                {
                    this.onConveyAlertHandler(Alert.OK, arg2);
                }
            }
            return;
        }

        /* internal  */onConveyAlertHandler(arg1: int, arg2: Object): void
        {
            var loc1=arg2 as STransportHelpInfo;
            if (arg1 == Alert.OK) 
            {
                if (RolePlayer.instance.entityInfo.isStall) 
                {
                    Alert.extendObj = loc1;
                    Alert.show(Language.getStringByParam(20293, Language.getString(20294), Language.getString(20294)), null, Alert.OK | Alert.CANCEL, null, this.onStallEndAlertHander);
                }
                else if (cache.trade.isTrading) 
                {
                    Alert.extendObj = loc1;
                    Alert.show(Language.getStringByParam(20293, Language.getString(20295), Language.getString(20295)), null, Alert.OK | Alert.CANCEL, null, this.onTradEndAlertHander);
                }
                else if (RolePlayer.instance.isDoubleRest) 
                {
                    Alert.extendObj = loc1;
                    Alert.show(Language.getStringByParam(20293, Language.getString(20296), Language.getString(20296)), null, Alert.OK | Alert.CANCEL, null, this.onRestEndAlertHander);
                }
                else if (cache.fish.isInFishing) 
                {
                    Alert.extendObj = loc1;
                    Alert.show(Language.getStringByParam(20293, Language.getString(20297), Language.getString(20297)), null, Alert.OK | Alert.CANCEL, null, this.onFishEndAlertHander);
                }
                else 
                {
                    GameProxy.sceneProxy.pass(EPassType.convert(EPassType._EPassTypeTransportHelp), loc1.mapId, loc1.x, loc1.y);
                }
            }
            return;
        }

        /* internal  */onFishEndAlertHander(arg1: int, arg2: Object): void
        {
            var loc1=null;
            if (arg1 == Alert.OK) 
            {
                loc1 = arg2 as STransportHelpInfo;
                GameProxy.sceneProxy.pass(EPassType.convert(EPassType._EPassTypeTransportHelp), loc1.mapId, loc1.x, loc1.y);
            }
            return;
        }

        /* internal  */onStallEndAlertHander(arg1: int, arg2: Object): void
        {
            if (arg1 == Alert.OK) 
            {
                this.humpHelpInfo = arg2 as STransportHelpInfo;
                NetDispatcher.addCmdListener(ServerCommand.StallCloseSuccess, this.onStallCloseSuccess);
                Dispatcher.dispatchEvent(new DataEvent(EventName.StallEndStall));
            }
            return;
        }

        /* internal  */onStallCloseSuccess(arg1: Object): void
        {
            NetDispatcher.removeCmdListener(ServerCommand.StallCloseSuccess, this.onStallCloseSuccess);
            GameProxy.sceneProxy.pass(EPassType.convert(EPassType._EPassTypeTransportHelp), this.humpHelpInfo.mapId, this.humpHelpInfo.x, this.humpHelpInfo.y);
            return;
        }

        /* internal  */onTradEndAlertHander(arg1: int, arg2: Object): void
        {
            if (arg1 == Alert.OK) 
            {
                this.humpHelpInfo = arg2 as STransportHelpInfo;
                Dispatcher.addEventListener(EventName.Trade_CancelSuccess, this.onTradeCancelSuccess);
                GameController.trade.view.hide();
            }
            return;
        }

        /* internal  */onTradeCancelSuccess(arg1: DataEvent): void
        {
            Dispatcher.removeEventListener(EventName.Trade_CancelSuccess, this.onTradeCancelSuccess);
            GameProxy.sceneProxy.pass(EPassType.convert(EPassType._EPassTypeTransportHelp), this.humpHelpInfo.mapId, this.humpHelpInfo.x, this.humpHelpInfo.y);
            return;
        }

        /* internal  */onRestEndAlertHander(arg1: int, arg2: Object): void
        {
            var loc1=null;
            if (arg1 == Alert.OK) 
            {
                loc1 = arg2 as STransportHelpInfo;
                GameProxy.sceneProxy.pass(EPassType.convert(EPassType._EPassTypeTransportHelp), loc1.mapId, loc1.x, loc1.y);
            }
            return;
        }

        /* internal  */onTaskEndRes(arg1: Object): void
        {
            var loc1=null;
            var loc2=0;
            if (arg1 && arg1.task) 
            {
                loc1 = arg1.task;
                if (loc1.sTask.group == ETaskGroup._ETaskGroupTransport) 
                {
                    this.hideTransportIcon();
                    this.hideTransportHelp();
                    if (this._transportInfo && !this._transportInfo.isHide) 
                    {
                        this._transportInfo.hide();
                    }
                    if (!(cache.role.entityInfo.level < 36 && cache.transport.transportInfo.count == 1)) 
                    {
                        if (!cache.dialog.hasActiveTask()) 
                        {
                            loc2 = cache.transport.transportInfo.maxCount - cache.transport.transportInfo.count;
                            if (loc2 > 0) 
                            {
                                Alert.showCloseBtn = true;
                                Alert.okLabel = Language.getString(20298);
                                Alert.buttonWidth = 100;
                                Alert.show(Language.getStringByParam(20299, HTMLUtil.addColor(cache.transport.transportInfo.rewardExp + "", "#ff00ff"), HTMLUtil.addColor(loc2 + "", "#00ff00")), null, Alert.OK, null, this.onContinueTransHandler);
                            }
                            else 
                            {
                                Alert.show(Language.getStringByParam(20307, HTMLUtil.addColor(cache.transport.transportInfo.rewardExp + "", "#ff00ff")));
                            }
                        }
                    }
                }
            }
            return;
        }

        /* internal  */onDoDailyHandler(arg1: int, arg2: DailyInfo): void
        {
            if (arg1 == Alert.OK) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.DailyActiveGoTo, arg2));
            }
            return;
        }

        /* internal  */onContinueTransHandler(arg1: int): void
        {
            if (arg1 == Alert.OK) 
            {
                AIManager.onAIControl(cache.scene.getNpcByEffect(ENpcEffect._ENpcEffectTransport), AIType.AI_Convey);
            }
            return;
        }

        /* internal  */onTaskUpdatesRes(arg1: Array<any>): void
        {
            var loc1=null;
            if (arg1.length > 0) 
            {
                loc1 = arg1[0];
                if (loc1 && loc1.sTask.group == ETaskGroup._ETaskGroupTransport && loc1.status == ETaskStatus._ETaskStatusHadFail) 
                {
                    this.hideTransportIcon();
                    if (this._transportInfo && !this._transportInfo.isHide) 
                    {
                        this._transportInfo.hide();
                    }
                }
            }
            return;
        }

        /* internal  */onTaskListRes(arg1: Array<any>): void
        {
            if (cache.guide.transportIng) 
            {
                GameProxy.transport.transportTaskInfoReq(0);
                RolePlayer.instance.addEventListener(PlayerEvent.WALK_START, this.onWalkStartHandler);
            }
            return;
        }

        /* internal  */onTaskDelRes(arg1: STask): void
        {
            if (arg1 && arg1.group == ETaskGroup._ETaskGroupTransport) 
            {
                this.hideTransportIcon();
                this.hideTransportHelp();
                if (this._transportInfo && !this._transportInfo.isHide) 
                {
                    this._transportInfo.hide();
                }
                RolePlayer.instance.removeEventListener(PlayerEvent.WALK_START, this.onWalkStartHandler);
            }
            return;
        }

        /* internal  */onKillTransRewardRes(arg1: MessageBlock): void
        {
            var loc3=null;
            var loc1=arg1.messageBase as SKillTransportReward;
            var loc2=Language.getStringByParam(20308, HTMLUtil.addColor(loc1.ownerMiniPlayer.name, ColorConfig.instance.getCampColor(loc1.ownerMiniPlayer.camp).color)) + HTMLUtil.addColor(Language.getString(20309), ColorConfig.instance.getItemColor(loc1.transportColor).color);
            if (loc1.rewardExp > 0) 
            {
                loc2 = loc2 + ("，" + Language.getStringByParam(20360, loc1.rewardExp));
            }
            if (loc1.rewardCoin > 0) 
            {
                loc2 = loc2 + ("，" + Language.getStringByParam(20361, loc1.rewardCoin));
            }
            if (loc1.rewardItemAmount > 0) 
            {
                loc3 = ItemConfig.instance.getInfoByCode(loc1.rewardItemCode);
                loc2 = loc2 + ("，" + Language.getStringByParam(20362, loc1.rewardItemAmount, HTMLUtil.addColor(loc3.item.name, ColorConfig.instance.getItemColor(loc3.item.color).color)));
            }
            loc2 = loc2 + "！";
            Alert.buttonWidth = 100;
            Alert.show(loc2, null, Alert.OK);
            return;
        }

        public showTrans(): void
        {
            this.showTransportIcon();
            return;
        }

        public hideIcon(): void
        {
            this.hideTransportIcon();
            this.hideTransportHelp();
            if (this._transportInfo && !this._transportInfo.isHide) 
            {
                this._transportInfo.hide();
            }
            return;
        }

        /* internal  */onTransportInfoCloseHandler(arg1: WindowEvent): void
        {
            this.showTransportIcon(false);
            return;
        }

        /* internal  */showTransportIcon(arg1: Boolean=false): void
        {
            if (!this.transportIcon.parent && cache.guide.transportIng && this.transportInfo.isHide) 
            {
                UiHintIconView.instance.addHintIcon(this.transportIcon, arg1);
            }
            return;
        }

        /* internal  */hideTransportIcon(): void
        {
            if (this._transportIcon && this._transportIcon.parent) 
            {
                this._transportIcon.parent.removeChild(this._transportIcon);
                EffectManager.glowFilterUnReg(this._transportIcon);
                this._transportIcon.dispatchEvent(new UIIconEvent(UIIconEvent.RemoveIcon));
            }
            return;
        }

        /* internal  */showTransportHelp(arg1: Boolean=false): void
        {
            if (!this.transportHelp.parent && cache.guide.transportIng) 
            {
                UiHintIconView.instance.addHintIcon(this.transportHelp, arg1);
            }
            return;
        }

        private /* var */_transport: ITransportModule;

        private /* var */_transportInfo: ITransportInfoModule;

        private /* var */_transportIcon: HintIcon;

        private /* var */_transportHelp: HintIcon;

        private /* var */_insuModuleType: int;

        private /* var */_flushTokenCoin: int=-1;

        private /* var */humpHelpInfo: STransportHelpInfo;
    }
